package com.zone.vehicle.sdk.module.superapp;

import com.zone.sdk.common.http.base.BaseRequest;
import com.zone.sdk.common.http.callback.ResultCallBack;
import com.zone.vehicle.sdk.module.superapp.cloud.SuperAppCloudServiceManager;
import com.zone.vehicle.sdk.module.superapp.cloud.request.AppListRequest;
import com.zone.vehicle.sdk.module.superapp.cloud.request.AppsDetailRequest;
import com.zone.vehicle.sdk.module.superapp.cloud.request.AppsDownloadQueueRequest;
import com.zone.vehicle.sdk.module.superapp.cloud.request.AppsDownloadRequest;
import com.zone.vehicle.sdk.module.superapp.cloud.request.AppsSyncAbilityListRequest;
import com.zone.vehicle.sdk.module.superapp.cloud.request.AppsUpdateListRequest;
import com.zone.vehicle.sdk.module.superapp.cloud.request.AppsUploadRequest;
import com.zone.vehicle.sdk.module.superapp.cloud.request.RecommendListRequest;
import com.zone.vehicle.sdk.module.superapp.cloud.request.SyncStatusRequest;
import com.zone.vehicle.sdk.module.superapp.cloud.request.UserRequest;
import com.zone.vehicle.sdk.module.superapp.vehicle.SuperAppVehicleServiceManager;

public class SuperAppManager {

    public static SuperAppManager instance;

    private final SuperAppCloudServiceManager superAppCloudServiceManager;
    private final SuperAppVehicleServiceManager superAppVehicleServiceManager;

    public static SuperAppManager getInstance(String appKey, String secret, String url){
        if(instance == null){
            instance = new SuperAppManager(appKey, secret, url);
            return instance;
        }
        return instance;
    }

    private SuperAppManager(String appKey, String secret, String url){
        superAppCloudServiceManager = SuperAppCloudServiceManager.getInstance(appKey, secret, url);
        superAppVehicleServiceManager = SuperAppVehicleServiceManager.getInstance();
    }

    public void appList(AppListRequest request, ResultCallBack<Void> callback){
        superAppCloudServiceManager.appList(request, callback);
    }

    /**
     * 应用状态同步
     * 
     * 
     */
    public void syncStatus(SyncStatusRequest request, ResultCallBack<Void> callback){
        superAppCloudServiceManager.syncStatus(request, callback);
    }

    /**
     * 应用更新列表查询
     * 
     * 
     */
    public void appsUpdateList(AppsUpdateListRequest request, ResultCallBack<Void> callback){
        superAppCloudServiceManager.appsUpdateList(request, callback);
    }

    /**
     * 获取活动内容
     * 
     * 
     */
    public void recommendList(RecommendListRequest request, ResultCallBack<Void> callback){
        superAppCloudServiceManager.recommendList(request, callback);
    }

    /**
     * 应用详情
     * 
     * 
     */
    public void appsDetail(AppsDetailRequest request, ResultCallBack<Void> callback){
        superAppCloudServiceManager.appsDetail(request, callback);
    }

    /**
     * 用户信息查询
     * 
     * 
     */
    public void user(UserRequest request, ResultCallBack<Void> callback){
        superAppCloudServiceManager.user(request, callback);
    }

    /**
     * 应用更新列表查询
     * 
     * 
     */
    public void appsDownload(AppsDownloadRequest request, ResultCallBack<Void> callback){
        superAppCloudServiceManager.appsDownload(request, callback);
    }

    /**
     * 开发者通过此接口将小程序的白名单同步到
     * appStore
     * 
     * 
     */
    public void appsSyncAbilityList(AppsSyncAbilityListRequest request, ResultCallBack<Void> callback){
        superAppCloudServiceManager.appsSyncAbilityList(request, callback);
    }

    /**
     * 车机端同步下载队列应用并由云端推送到手机端
     * 
     * 
     */
    public void appsDownloadQueue(AppsDownloadQueueRequest request, ResultCallBack<Void> callback){
        superAppCloudServiceManager.appsDownloadQueue(request, callback);
    }

    /**
     * 文件上传（图片）
     * 
     * 
     */
    public void appsUpload(AppsUploadRequest request, ResultCallBack<Void> callback){
        superAppCloudServiceManager.appsUpload(request, callback);
    }

    /**
     * 车机端同步下载队列应用并由云端推送到手机端
     * 
     * 
     */
    public void appSearch(BaseRequest request, ResultCallBack<Void> callback){
        superAppCloudServiceManager.appSearch(request, callback);
    }

    /**
     * 下载用户对app进行评价及安利
     * 
     * 
     */
    public void commentEditComment(BaseRequest request, ResultCallBack<Void> callback){
        superAppCloudServiceManager.commentEditComment(request, callback);
    }

    /**
     * 下载用户对app下的用户评论进行回复
     * 
     * 
     */
    public void commentEditReply(BaseRequest request, ResultCallBack<Void> callback){
        superAppCloudServiceManager.commentEditReply(request, callback);
    }

    /**
     * 对用户的评论进行点赞
     */
    public void commentCommentPraise(BaseRequest request, ResultCallBack<Void> callback){
        superAppCloudServiceManager.commentCommentPraise(request, callback);
    }

    /**
     * 用户评论审核不通过，可对当前评论进行修改
     * 
     * 
     */
    public void commentInitCommentDetail(BaseRequest request, ResultCallBack<Void> callback){
        superAppCloudServiceManager.commentInitCommentDetail(request, callback);
    }

    /**
     * 用户评论审核不通过，可对当前评论进行修改
     * 
     * 
     */
    public void commentUpdateComment(BaseRequest request, ResultCallBack<Void> callback){
        superAppCloudServiceManager.commentUpdateComment(request, callback);
    }

    /**
     * 显示app总体评分和所有用户评价列表
     * 
     * 
     */
    public void commentCommentScore(BaseRequest request, ResultCallBack<Void> callback){
        superAppCloudServiceManager.commentCommentScore(request, callback);
    }

    /**
     * 显示app总体评分和所有用户评价列表
     * 
     * 
     */
    public void commentCommentList(BaseRequest request, ResultCallBack<Void> callback){
        superAppCloudServiceManager.commentCommentList(request, callback);
    }

    /**
     * 显示app总体评分和所有用户评价列表
     * 
     * 
     */
    public void commentCommentDetail(BaseRequest request, ResultCallBack<Void> callback){
        superAppCloudServiceManager.commentCommentDetail(request, callback);
    }

    /**
     * 分页显示安利墙列表
     * 
     * 
     */
    public void commentInitAmwayWallList(BaseRequest request, ResultCallBack<Void> callback){
        superAppCloudServiceManager.commentInitAmwayWallList(request, callback);
    }

    /**
     * 用户查看自己评论过的信息列表
     * 
     * 
     */
    public void commentUserCommentList(BaseRequest request, ResultCallBack<Void> callback){
        superAppCloudServiceManager.commentUserCommentList(request, callback);
    }

    /**
     * 用户删除自己的评论
     * 
     * 
     */
    public void commentDelUserComment(BaseRequest request, ResultCallBack<Void> callback){
        superAppCloudServiceManager.commentDelUserComment(request, callback);
    }

    /**
     * 查询应用下评论数，不包含回复和回复回复
     * 
     * 
     */
    public void commentSearchCommentCount(BaseRequest request, ResultCallBack<Void> callback){
        superAppCloudServiceManager.commentSearchCommentCount(request, callback);
    }

    /**
     * 用户提交意见反馈
     * 
     * 
     */
    public void feedbackFeedbackCommit(BaseRequest request, ResultCallBack<Void> callback){
        superAppCloudServiceManager.feedbackFeedbackCommit(request, callback);
    }

    /**
     * 车机端同步下载队列应用并由云端推送到手机端
     * /user/captchacert/exchange/v1
     * 
     * 
     */
    public void captchacertExchange(BaseRequest request, ResultCallBack<Void> callback){
        superAppCloudServiceManager.captchacertExchange(request, callback);
    }

    /**
     * 手机号+验证码登录/注册/忘记密码流程中，调用此接口获取短信验证码
     * 
     * 
     */
    public void loginPhoneCode(BaseRequest request, ResultCallBack<Void> callback){
        superAppCloudServiceManager.loginPhoneCode(request, callback);
    }

    /**
     * 手机号+验证码登录/注册/忘记密码流程中，调用此接口获取短信验证码
     * 与获取验证码接口相同，请求参数做区分 loginPhoneCode
     * 
     * 
     */
    public void loginPhoneCodeCheck(BaseRequest request, ResultCallBack<Void> callback){
        superAppCloudServiceManager.loginPhoneCode(request, callback);
    }

    /**
     * 手机号+密码登录流程中，调用此接口提交登录请求，并获取登录信息
     * 
     * 
     */
    public void loginPhonePwd(BaseRequest request, ResultCallBack<Void> callback){
        superAppCloudServiceManager.loginPhonePwd(request, callback);
    }

    /**
     * 用户持有有效Access Token 状态下，调用此接口设置密码。
     * 
     * 
     */
    public void userPwdModify(BaseRequest request, ResultCallBack<Void> callback){
        superAppCloudServiceManager.userPwdModify(request, callback);
    }

    /**
     * 用户持有有效Access Token 状态下，调用此接口获取个人基本信息
     * 
     * 
     */
    public void queryUserInfo(BaseRequest request, ResultCallBack<Void> callback){
        superAppCloudServiceManager.queryUserInfo(request, callback);
    }

    /**
     * 用户持有有效Access Token 状态下，调用此接口修改个人基本信息。
     * 
     * 
     */
    public void updateUserInfo(BaseRequest request, ResultCallBack<Void> callback){
        superAppCloudServiceManager.updateUserInfo(request, callback);
    }

    /**
     * 用户持有有效Access Token 状态下，调用此接口退出当前账号
     * 
     * 
     */
    public void logout(BaseRequest request, ResultCallBack<Void> callback){
        superAppCloudServiceManager.logout(request, callback);
    }

    /**
     * 用户Access Token 过期状态下，调用此接口以获取新的Token。
     * 
     * 
     */
    public void refreshToken(BaseRequest request, ResultCallBack<Void> callback){
        superAppCloudServiceManager.refreshToken(request, callback);
    }

    /**
     * 用户持有有效Access Token 状态下，调用此接口上传文件（移动端用于上传自定义头像）。
     * 
     * 
     */
    public void userUpload(BaseRequest request, ResultCallBack<Void> callback){
        superAppCloudServiceManager.userUpload(request, callback);
    }

    /**
     * 用户持有有效Access Token 状态下，调用此接口查询当前账户在所有设备上的登录状态
     * 
     * 
     */
    public void loginStatus(BaseRequest request, ResultCallBack<Void> callback){
        superAppCloudServiceManager.loginStatus(request, callback);
    }

    /**
     * 车机端调用此接口生成登录二维码，返回的是QR Code URL
     * 
     * 
     */
    public void qrLoginCode(BaseRequest request, ResultCallBack<Void> callback){
        superAppCloudServiceManager.qrLoginCode(request, callback);
    }

    /**
     * 车机端通过此接口轮询登录状态。
     * 
     * 
     */
    public void qrLoginCodeStatus(BaseRequest request, ResultCallBack<Void> callback){
        superAppCloudServiceManager.qrLoginCodeStatus(request, callback);
    }

}
